<template>
  <div v-if="GLOBAL.sysUserVisible=='1'">

    <el-table
        stripe
        :row-style="{height:'45px'}"
        :cell-style="{padding:'0px'}"
        style="font-size: 14px;width: 100%"
        :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        :data= miniTable >
        <el-table-column
          prop="index"
          align="center"
          label="序号"
          width="80">
        </el-table-column>
        <el-table-column
          align="center"
          prop="stname"
          label="姓名"
          width="80"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="stid"
          label="学号"
          width="120"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="age"
          label="年龄"
          width="60"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="department"
          label="学校"
          width="120"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="college"
          label="专业"
          width="80"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="stype"
          label="学历"
          width="80"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="year"
          label="入学年份"
          width="90"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="mini_time"
          label="完成时间"
          width="180"
          :show-overflow-tooltip='true' >
        </el-table-column>
        <el-table-column
          align="center"
          prop="mini_result"
          label="mini结果"
          width="200"
          :show-overflow-tooltip='true' >
        </el-table-column>
      <el-table-column  align="center" label="设置">
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="showInfo( scope.row)">查看更多</el-button>
        </template>
      </el-table-column>
      </el-table>
  </div>
</template>

<script>
    export default {
        name: "MiniResult",
        created() {
            this.initData();
        },
        methods: {
            showInfo(row){
                this.$router.push({path:"/home/miniInfoCheck",query:{info:row}});
            },
            initData() {
                this.$axios.post("managementSystem/user/miniResult",{})
                    .then(data => {
                        if (data.status != 200) {
                            this.$message.error('服务出错' + data.status);
                        } else {
                            this.miniTable=data.data.data;
                            for (var i in this.miniTable) {
                                this.miniTable[i]["index"] = parseInt(i) + 1;
                                if(this.miniTable[i]["stype"]==2){
                                    this.miniTable[i]["stype"] = '博士'
                                }else if(this.miniTable[i]["stype"] ==1){
                                    this.miniTable[i]["stype"] = '硕士'
                                }else if(this.miniTable[i]["stype"] ==0){
                                    this.miniTable[i]["stype"] = '本科'
                                }else if(this.miniTable[i]["stype"] ==3){
                                    this.miniTable[i]["stype"] = '初中'
                                }else if(this.miniTable[i]["stype"] ==4){
                                    this.miniTable[i]["stype"] = '高中'
                                }else if(this.miniTable[i]["stype"] ==5){
                                    this.miniTable[i]["stype"] = '大专'
                                }
                            }
                        }
                    });
            }
        },
        data() {
            return {
                miniTable: [],
            }
        }
    }
</script>

<style scoped>

</style>
